package com.ftg.learn.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName("`order`")
@Schema(description = "订单实体类")
public class Order {
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    String id;

    @TableField("number")
    @Schema(description = "订单编号")
    String number;

    @TableField("user_id")
    @Schema(description = "用户id")
    Long userId;

    @TableField("status")
    @Schema(description = "订单状态 1待付款 2.已取消 3.已完成")
    Integer status;

    @TableField("pay_type")
    @Schema(description = "支付方式")
    String payType;

    @TableField("pay_status")
    @Schema(description = "支付状态")
    Integer payStatus;

    @TableField("order_time")
    @Schema(description = "下单时间")
    LocalDateTime orderTime;

    @TableField("checkout_time")
    @Schema(description = "结账时间")
    LocalDateTime checkoutTime;

    @TableField("amount")
    @Schema(description = "订单金额")
    BigDecimal amount;

    @TableField("phone")
    @Schema(description = "手机号")
    String phone;

}
